package pres.lnk.learn.designpattern.g_bridge;

import pres.lnk.learn.designpattern.g_bridge.color.RedColor;
import pres.lnk.learn.designpattern.g_bridge.color.YellowColor;
import pres.lnk.learn.designpattern.g_bridge.shape.Circle;
import pres.lnk.learn.designpattern.g_bridge.shape.Rectangle;
import pres.lnk.learn.designpattern.g_bridge.shape.Shape;

/**
 * <p>桥接模式</p>
 * 分离出抽象实现部分功能，扩展的子类只需要部分细节功能
 * 桥接类为具体的业务实现，与抽象类可以组合更多的功能
 * @Author lnk
 * @Date 2018/2/7
 */
public class Main {
    public static void main(String[] args) {
        Shape shape = new Circle();
        shape.setColor(new RedColor());
        shape.draw();

        shape = new Rectangle();
        shape.setColor(new YellowColor());
        shape.draw();
    }
}
